import { SelectProps } from "antd"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useLocale } from "@/locales"

const GameListSelect = ({
	name,
	labelId,
	placeholderId,
	rules,
	...props
}: { name?: string; labelId?: string; placeholderId: string; rules?: [] } & SelectProps) => {
	const { formatMessage } = useLocale()

	return (
		<SFormItem name={name} label={labelId ? `${formatMessage({ id: labelId })}` : ""} rules={rules}>
			<StyleSelect placeholder={formatMessage({ id: placeholderId })} {...props} />
		</SFormItem>
	)
}

export default GameListSelect
